﻿using System.Collections.Generic;
using System.Data;

namespace SyncCuringData
{
    public class DataProcess
    {
        public static PetaPoco.Database db
        {
            get
            {
                return new PetaPoco.Database("Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.18.0.242)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=lterpdata)));User Id=LEILI;Password=123456", "Oracle");
            }
        }

        /// <summary>
        /// 获得第三方固化数据表数据
        /// </summary>
        /// <param name="strSQL"></param>
        /// <returns></returns>
        public static List<CuringPlate> GetCuringPlateList(string strSQL)
        {
            List<CuringPlate> listCuringPlate = db.Fetch<CuringPlate>(strSQL);
            return listCuringPlate;
        }

        /// <summary>
        /// 更新第三方固化表数据
        /// </summary>
        /// <returns></returns>
        public static bool UpdateCuringPlateData(string strSQL)
        {
            return db.Execute(strSQL) > 0 ? true : false;
        }
    }
}
